home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
The World of Computer Software.iso
/
pcmagwin.zip
/
WINTIDY.DOC
< prev
next >
Wrap
Text File
|
1992-12-08
|
8KB
|
135 lines
WINTIDY.EXE (Version 1.0) Copyright (c) 1992 by Neil J. Rubenking
-------------------------------------------------------------------------
First Published in PC Magazine January 12, 1993 (Utilities)
-------------------------------------------------------------------------
WINTIDY:
WINTIDY is a Windows 3.1 specific utility that lets you keep your
Program Manager organized. WINTIDY can arrange the icons in every group
window. In addition, it can save the ProgMan layout, including iconic
location, normal window size, and display state (minimized, maximized,
or normal) for each group window, along with the location of the items
within each group window. If you experiment with a new layout, at the
click of a button, WIN~TIDY will restore the ProgMan layout you last saved.
WINTIDY requires Windows 3.1, because some of the necessary
programming functions were not introduced prior to that version. (Windows
programmers will be amazed at the contortions this apparently simple
program must go through behind the scenes.) And, of course, if you use
a program other than Program Manager as your Windows shell, WINTIDY
can't help you.
If you want to work from the source code, you'll need Borland
Pascal 7.0 or Turbo Pascal for Windows (TPW) 1.5 to compile the program.
USING WINTIDY
To install the program, simply copy WINTIDY.EXE into your utilities
directory. If you wish, you can also copy the supplied WINTIDY.INI file
into your Windows directory. (WINTIDY will create an .INI file there if
it doesn't find one.) Then simply use the New command from ProgMan's File
menu to install WINTIDY in the group of your choice.
WINTIDY's main menu consists of three items: File, Action, and
Help. The File menu contains nothing but the standard Exit command, and
the Help menu's two items display an About box and a brief explanation
of how to use WINTIDY. You'll find Save Layout, Restore Layout, and
Arrange Icons in the program's Action menu.
The first time you use WINTIDY, you'll probably want to start by
selecting the Arrange Icons command. When you do so, the Program Manager
will disappear for a moment and will then reappear with all of its group
windows closed and all the group icons lined up in rows. If you now Open
any group window, you'll find the icons inside will be nicely arranged
in rows and columns.
From this orderly starting point, you can move the group window
icons into an arrangement that makes sense to you. I like to put the
group window icons along the top and left edges of the ProgMan window,
leaving a large blank rectangular area. I can then open each group window
and position it so it fits in that blank area. Your own preferred layout
may differ, of course. After placing the group icons, open each group
window, adjust its size and position, and locate the icons within the
window to suit yourself. If one of the items in the group is used more
than the others, you'll probably want to put it in the top left corner
or in some other distinctive position.
When you've created the desired ProgMan layout, choose WINTIDY's
Save Layout command. After a moment, WINTIDY should report success, and
you'll find that it has created the file WINTIDY.INI in your Windows
directory. This file follows the standard .INI format and so will serve
as an easily readable record of your layout. I don't recommend that you
edit this .INI file, however, for a mistake could render one of your
groups or icons invisible.
Now, when hours or days of using ProgMan have made a muddle of
your layout, just choose the Restore Layout command from the WINTIDY
Action menu. Program Manager will disappear briefly, then reappear with
everything arranged just as it was when you last saved the layout.
I should note that since WINTIDY must modify ProgMan's .GRP files
when it restores a layout, a minor risk is involved. If something were
to prevent WINTIDY from completing the modification, the binary .GRP
file could be damaged, rendering the corresponding group inaccessible.
The same thing would be true if, for example, the power failed while
ProgMan itself was writing to a .GRP file. I suggest, therefore, that
you copy your .GRP files to a backup directory right now and update
your backup copies regularly.
WINTIDY obviously can't restore a group you have added since the
last time you saved the layout. If the program encounters a new group
during the restore process, it will report that fact in a message box.
My suggestion for maintaining an orderly ProgMan window while adding new
groups or program items would be to
use WINTIDY to restore the saved layout,
add the new program item or group and place it so as to fit
into your layout, and then
use WINTIDY to save the modified layout.
Keeping a single ProgMan layout isn't always enough. You might,
for example, want to use one layout with 1,024-by-768 resolution and
another for 640-by-480. And you may want to keep an existing layout safe
while experimenting with a new one. WINTIDY lets you do so simply by
running it with an alternate .INI filename on its command line. Note
that when you do this WINTIDY pays attention to the filename portion
only; the utility supplies its own .INI extension. Thus, if you were
to put C:\DOS\SNAFU.DAT on the command line, WINTIDY would interpret
this as a request to use the file SNAFU.INI in the Windows directory.
When WINTIDY works with a layout file other than the default
WINTIDY.INI, it appends the layout name to its title line. You can even
compare layouts by running multiple copies of WINTIDY at once, each with
its own layout file. Just select the Restore Layout command from each in
turn to experiment with different layouts.
WINTIDY LAYOUT FILE STRUCTURE
I chose the .INI file format for saving WINTIDY's layout data
because so much of that data consists of variable length text strings.
Besides, Windows itself has built-in support for .INI files, which
simplifies the process of reading and writing the data. A WINTIDY.INI
file always contains two sections: [Groups] and [Progman.Itself].
Each key in the [Groups] section is the name of a ProgMan group, and the
key's value is a string of ten numbers that define a TWindowPlacement
data structure for the group window. The [Progman.Itself] section has
a single key, Placement, again with a value consisting of ten numbers.
This value defines ProgMan's own placement.
Every key in the [Groups] section is also the name of a section that
holds information about that group. Each key in the latter sections is
the name of a program item within the group, the key's value being the
location of the item in the group window.
WINTIDY will behave a bit oddly in the rare event that you make a
group that contains two program items with precisely the same name.
Windows doesn't allow two keys with the same name in one section of an
.INI file; the second simply overwrites the first. Even apart from this
restriction, it's never a good idea to give the exact same name to
different program items. If you do, however, and if you then save and
restore the layout, WINTIDY will place the second item directly on top
of the first!
------------------------------------------------------------------------
NEIL J. RUBENKING IS TECHNICAL EDITOR OF PC MAGAZINE.